<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:p="http://primefaces.org/ui">
<h:head>  </h:head>
<f:metadata>
    <f:viewParam name="m" value="#{homeBean.successMessage}" />
    <f:viewParam name="i" value="#{homeBean.invitationLink}" />
    <f:viewAction action="#{reservationBean.initCustomer()}" />
    <f:viewAction action="#{homeBean.initHome()}" />
</f:metadata>
<h:body> 
	<h2>Benvenuto #{homeBean.username}</h2>
	<h:panelGrid columns="1">
		<p:panel style="width:100%; color: red" rendered="#{not empty homeBean.successMessage}">
			<h:outputLabel value="#{homeBean.successMessage}" /><br />
			<h:outputLabel rendered="#{not empty homeBean.invitationLink}" value="Invitation link: /traveldreamWeb/ViewFriendReservation.xhtml?i=#{homeBean.invitationLink}" />
		</p:panel>
		<p:panel rendered="#{not empty homeBean.joinSuccess}">
			<h:outputLabel value="#{homeBean.joinSuccess}" style="color: red" />
		</p:panel>
        <p:button outcome="PackageList.xhtml" value="Choose Your Travel Dream" icon="ui-icon-suitcase
 "/>  
        <p:button outcome="ReservationList.xhtml" value="View Your Reservations" />
        <h:form>
        
        <p:commandButton action="#{logoutBean.logout()}" value="Logout" /> 
        </h:form>
        
        <h:outputLabel value="#{homeBean.error}" />
    </h:panelGrid> 
</h:body>
</html>